#undef BLENDCOLOR
#undef BLENDPIXEL
#undef BLEND2PIXEL

#define BLENDCOLOR MAKE_BLENDCOLOR(BLEND_MODE, MMX)
#define BLENDPIXEL MAKE_BLENDPIXEL(BLEND_MODE, MMX)
#define BLEND2PIXEL MAKE_BLEND2PIXEL(BLEND_MODE)

BOOL BLENDCOLOR(PBITMAP lpbDst, xARGB x)
{
    LPBYTE lpScanLine = (LPBYTE)lpbDst->bmBits;
    DWORD width = lpbDst->bmWidth;
    __m64 mclr = _m_from_int(x.argb);
    mclr = _m_punpckldq(mclr, mclr);
    for (int j = lpbDst->bmHeight; j > 0; j--)
    {
        LPDWORD lpPixel = (LPDWORD)lpScanLine;
        int i = width >> 1;
        while (i--)
        {
            BLEND2PIXEL(*((__m64*)lpPixel), mclr);
            lpPixel += 2;
        }
        if (width & 1)
        {
            BLENDPIXEL(*lpPixel, x.argb);
        }
        lpScanLine += lpbDst->bmWidthBytes;
    }
    _m_empty();
    return TRUE;
}